Hi,
void addPlfm(DBE dbe)
{
AttrType at = find(current ,"platform")
AttrSize = at.size
for (i=0;i<AttrSize;i++)
{
print at.values[i] ": " at.strings[i] "\n" //current values are output correctly
}
string p = get(newPlfm) // New enumeration from DBE Field
string errMess = ""
string new_strings[at.size+1]
int new_values[at.size+1]
int new_colors[at.size+1]
for(i=0;i < at.size; i++)
{
new_strings[i] = at.strings[i]
new_values[i] = at.values[i]
new_colors[i] = at.colors[i]
}
new_strings[at.size] = p
new_values[at.size] = at.size
new_colors[at.size] = -1
AttrType at_new = modify(at,"platform",new_strings,new_values,new_colors,errmsg)
}
mwilliamson - Tue Sep 15 11:33:31 EDT 2009 |
Re: Addition of Enumeration Values Here's from the v9.2 manual:
AttrType modify(AttrType type, string newName [, string codes[ ], int values[ ], int colors[ ],
string descs[ ],[int arrMaps[ ],]] string &errmess)
If supplied, codes, values, colors and descs modify those properties of an existing enumerated type.
In the GUI, the term values maps to codes, and the term related numbers maps to values.
If the type is being used by an attribute, colors cannot be added where they weren't previously assigned,
and, arrMaps must be supplied in order to map old values to the new ones.
|
Re: Addition of Enumeration Values llandale - Tue Sep 15 12:30:13 EDT 2009 Here's from the v9.2 manual:
AttrType modify(AttrType type, string newName [, string codes[ ], int values[ ], int colors[ ],
string descs[ ],[int arrMaps[ ],]] string &errmess)
If supplied, codes, values, colors and descs modify those properties of an existing enumerated type.
In the GUI, the term values maps to codes, and the term related numbers maps to values.
If the type is being used by an attribute, colors cannot be added where they weren't previously assigned,
and, arrMaps must be supplied in order to map old values to the new ones.
I made the alterations and with the exception of at.descs, which does not seem to be recognised in my DOORS 9.2 client, it is working ok. Lots of error checking and access checking to do but the core function is there. Thanks again Mark |
Re: Addition of Enumeration Values mwilliamson - Tue Sep 15 15:17:18 EDT 2009 Looks like its 'at.descriptions[i]' I see the AT can have a 'description' starting in v9.0, but I see no where in the GUI manual how you place or view a 'description' on each enumerated value. but I see that it can be good, use a short Accronym as the string and spell it out in the Description.
|
Re: Addition of Enumeration Values llandale - Tue Sep 15 17:50:20 EDT 2009
Hello, Can you please let me know how to add an enum value to the attribute?? |